<template>
  <div class="total">

    <!-- <link rel="stylesheet" type="text/css" href="../addons/ewei_shopv2/template/mobile/default/static/css/coupon-new.css?v=2017030310125"> -->
    <div class="fui-header">

      <div class="fui-content navbar coupon-page">

        <div class="coupon-detail red ">
          <div class="detail-dots"></div>
          <div class="detail-head">
            <div class="inner">
              <div class="title">
                <div class="text">5折优惠券</div>
              </div>
              <div class="bigtitle"> 5折 </div>
              <div class="subtitle"> 领取即可使用 </div>
              <div class="usetime">
                <div class="text">有效期: 即领取日内 7 天有效
                </div>
              </div>
            </div>
          </div>

          <div class="detail-body">
            <div class="block">
              <div class="title">使用说明</div>
              <div class="text">
                <p>限微信群用户领取。</p>
                <p>
                  <br>
                </p>
                <p>领取后，在购买专家服务页面使用优惠券，即可享受5折优惠。</p>
              </div>
            </div>
            <div class="block">
              <div class="title">领取限制</div>
              <div class="text dot">无</div>
            </div>
            <div class="block">
              <div class="title">有效期限</div>
              <div class="text dot">
                即领取日内 7 天有效
              </div>
            </div>
            <div class="block">
              <div class="title">使用限制</div>
              <div class="text dot">不允许与促销优惠同时使用</div>
              <div class="text dot">允许以下商品分类使用:</div>
              <div class="text">
                专家服务&nbsp;
              </div>
            </div>
          </div>
        </div>
      </div>
      <div class="fui-navbar" @click="receive">
        <div class="nav-item btn btn-red " id="btncoupon">立即领取</div>
      </div>
    </div>

    <div class="wanc" v-show="yjgm">
      <div class="wanc-a">
        <div class="wanc-b">您已经成功领取了优惠券，赶快去购买服务吧！</div>
        <!-- <div class="wanc-c" @click="nogt">知道了</div> -->
        <div class="wanc-c">
          <div class="wanc-c-a" @click="noyjgm">知道了</div>
          <div class="wanc-c-a yvs" @click="go">去购买</div>
        </div>
      </div>
    </div>
    <div class="wanc" v-show="yjgmb">
      <div class="wanc-a">
        <div class="wanc-b">
          <div class="wanc-d">恭喜，您已成功领取优惠券。</div>
          <div class="wanc-d">请关注下方二维码购买专家服务</div>
        </div>
        <!-- <div class="wanc-d">请关注下方二维码购买专家服务</div> -->
        <img class="wanc-img" src="../assets/微信.jpg">
        <!-- <div class="wanc-c" @click="nogt">知道了</div> -->
        <!-- <div class="wanc-c">
          <div class="wanc-c-a" @click="noyjgm">知道了</div>
          <div class="wanc-c-a yvs" @click="go">去购买</div>
        </div> -->
      </div>
    </div>

  </div>
</template>

<script>
export default {
  data() {
    return {
      yjgm: false,
      yjgmb: false
    };
  },

  created() {
    this.$axios.get("/public/index/dist/info").then(response => {
      this.sures = response.data;
      console.log(this.sures);
    });
  },

  mounted() {
    //   console.log(this.$route.params.id);
  },

  updated() {},

  methods: {
    receive() {
      this.$axios
        .post("/public/index/dist/coupons", {
          uid: this.sures.uid,
          discount: 0.5,
          title: "新年五折优惠券",
          time: 7
        })
        .then(Response => {
          var sures = Response.data;
          console.log(sures);
          if (sures.code == 0) {
            this.yjgmb = true;
          } else if (sures.code == 1) {
            this.yjgm = true;
          }
        });
    },
    noyjgm() {
      this.yjgm = false;
    },
    go() {
      this.yjgm = false;
      window.location.href =
        "https://wx1.dahe2016.com/public/index/sorder/index";
    }
  }
};
</script>
<style lang='scss' scoped>
.total {
  width: 100%;
  background: #ededed;
  // display: flex;
  // flex-direction: column;
  // align-items: center;
  font-size: 30px;
}
.coupon-page {
  background: #ededed;
}
/* 优惠券列表 默认蓝色调 */
.coupon-tip {
  height: 170px;
  margin: 20px 20px 0;
  padding: 0 26px 0 32px;
  background: #fbfbfb;
  display: -webkit-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  -ms-flex-align: center;
  align-items: center;
}
.coupon-tip .text {
  // -webkit-box-flex: 1;
  // -webkit-flex: 1;
  // -ms-flex: 1;
  // flex: 1;
  color: #666;
}
.coupon-tip .text .title {
  font-size: 40px;
}
.coupon-tip .text .subtitle {
  font-size: 30px;
}
.coupon-tip span {
  color: #ff5555;
}
.coupon-tip .icon {
  height: 128px;
  width: 256px;
  //   background: url("../images/newcoupon/tip-icon.jpg") center no-repeat;
  background-size: 100%;
}
.coupon-list {
  height: auto;
  padding: 20px;
  overflow: hidden;
}
.coupon-item {
  height: 200px;
  margin-top: 20px;
  background: #ffffff;
  display: -webkit-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  position: relative;
  overflow: hidden;
}
.coupon-item:first-child {
  margin-top: 0;
}
.coupon-dots {
  height: inherit;
  width: 16px;
  position: absolute;
  top: 0;
  left: -0.22px;
  z-index: 10;
}
.coupon-dots i {
  height: 16px;
  width: 16px;
  border-radius: 16px;
  background: #ededed;
  display: block;
}
.coupon-dots:before,
.coupon-dots:after {
  content: "";
  height: 20px;
  width: 20px;
  background: #ededed;
  border-radius: 20px;
  position: absolute;
  left: 5.22px;
}
.coupon-dots:before {
  top: -0.22px;
}
.coupon-dots:after {
  bottom: -0.22px;
}
.coupon-item .coupon-type {
  width: 160px;
  text-align: center;
  padding: 0.4px 0;
  background: #55b5ff;
  font-size: 20px;
  color: #ffffff;
  position: absolute;
  top: 0;
  right: 0;
  transform: rotate(45deg);
  -ms-transform: rotate(45deg);
  -moz-transform: rotate(45deg);
  -webkit-transform: rotate(45deg);
  -o-transform: rotate(45deg);
  transform-origin: 80px 80px;
  -webkit-transform-origin: 80px 80px;
  -ms-transform-origin: 80px 80px;
  -moz-transform-origin: 80px 80px;
  -o-transform-origin: 80px 80px;
  z-index: 10;
}
.coupon-item .coupon-left {
  height: inherit;
  width: 5.22px;
  background: #55b5ff;
  color: #fff;
  text-align: center;
  display: -webkit-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  flex-direction: column;
  -webkit-flex-direction: column;
  justify-content: center;
  -webkit-justify-content: center;
  -ms-justify-content: center;
  -moz-justify-content: center;
}
.coupon-item .coupon-left .title {
  font-size: 1.8px;
  font-weight: bold;
}
.coupon-item .coupon-left .subtitle {
  font-size: 30px;
}
.coupon-item .coupon-left .single {
  font-size: 1.2px;
}
.coupon-item .coupon-left img {
  height: 100%;
  width: 100%;
}
.coupon-item .coupon-right {
  padding: 20px;
  -webkit-box-flex: 1;
  -webkit-flex: 1;
  -ms-flex: 1;
  flex: 1;
}
.coupon-item .coupon-right .title {
  font-size: 32px;
  height: 1.8px;
  color: #1a1a1a;
  overflow: hidden;
}
.coupon-item .coupon-right .subtitle {
  height: 36px;
  line-height: 36px;
  font-size: 32px;
  color: #666;
  text-overflow: -o-ellipsis-lastline;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}
.coupon-item .coupon-right .subtitle.light {
  color: #55b5ff;
}
.coupon-item .coupon-right .subtitle.bold {
  font-weight: bold;
}
.coupon-item .coupon-right .usetime {
  line-height: 1.16px;
  font-size: 30px;
  color: #999;
  display: -webkit-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
}
.coupon-item .coupon-right .usetime .text {
  -webkit-box-flex: 1;
  -webkit-flex: 1;
  -ms-flex: 1;
  flex: 1;
}
.coupon-item .coupon-right .usetime .usebtn {
  height: 1.4px;
  width: 128px;
  line-height: 1.4px;
  text-align: center;
  border: 2px solid #55b5ff;
  border-radius: 1.4px;
  color: #55b5ff;
}
/* 优惠券picker样式 */
.coupon-picker {
  background: #ededed;
  max-height: 1200px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
/* 优惠券picker样式(mini) */
.coupon-list.mini .coupon-item {
  height: 3.2px;
}
.coupon-list.mini .coupon-item .coupon-after {
  width: 160px;
  padding-right: 20px;
  display: -webkit-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  flex-direction: column;
  -webkit-flex-direction: column;
  justify-content: center;
  -webkit-justify-content: center;
  -ms-justify-content: center;
  -moz-justify-content: center;
}
.coupon-list.mini .coupon-item .coupon-after .coupon-btn {
  width: 3.2px;
  height: 1.2px;
  line-height: 1.2px;
  border: 2px solid #55b5ff;
  border-radius: 1.2px;
  color: #55b5ff;
  text-align: center;
  font-size: 30px;
}
.coupon-list.mini .coupon-item.red .coupon-after .coupon-btn {
  border-color: #fd5554;
  color: #fd5554;
}
.coupon-list.mini .coupon-item.pink .coupon-after .coupon-btn {
  border-color: #fd72d4;
  color: #fd72d4;
}
.coupon-list.mini .coupon-item.orange .coupon-after .coupon-btn {
  border-color: #ff913f;
  color: #ff913f;
}
.coupon-list.mini .coupon-item.gray .coupon-after .coupon-btn {
  border-color: #b3b3b3;
  color: #b3b3b3;
}
/* 优惠券列表 其他色调 */
.coupon-item.red .coupon-left,
.coupon-item.red .coupon-type {
  background: #fd5554;
}
.coupon-item.red .coupon-right .usetime .usebtn {
  color: #fd5554;
  border-color: #fd5554;
}
.coupon-item.red .coupon-right .subtitle.light {
  color: #fd5554;
}
.coupon-item.pink .coupon-left,
.coupon-item.pink .coupon-type {
  background: #fd72d4;
}
.coupon-item.pink .coupon-right .usetime .usebtn {
  color: #fd72d4;
  border-color: #fd72d4;
}
.coupon-item.pink .coupon-right .subtitle.light {
  color: #fd72d4;
}
.coupon-item.orange .coupon-left,
.coupon-item.orange .coupon-type {
  background: #ff913f;
}
.coupon-item.orange .coupon-right .usetime .usebtn {
  color: #ff913f;
  border-color: #ff913f;
}
.coupon-item.orange .coupon-right .subtitle.light {
  color: #ff913f;
}
.coupon-item.gray .coupon-left,
.coupon-item.gray .coupon-type {
  background: #b3b3b3;
}
.coupon-item.gray .coupon-right .usetime .usebtn {
  color: #b3b3b3;
  border: 0;
}
.coupon-item.gray .coupon-right .subtitle.light {
  color: #b3b3b3;
}
/* 详情页样式 默认蓝色调 */
.coupon-detail {
  height: auto;
  padding: 20px;
  overflow: hidden;
}
.coupon-detail .detail-dots {
  height: 36px;
  position: absolute;
  top: 354px;
  left: 5px;
  right: 5px;
  overflow: hidden;
  z-index: 2;
}
.coupon-detail .detail-dots:before,
.coupon-detail .detail-dots:after {
  content: "";
  height: 36px;
  width: 36px;
  background: #ededed;
  border-radius: 36px;
  position: absolute;
  top: 0;
}
.coupon-detail .detail-dots:before {
  left: -0.42px;
}
.coupon-detail .detail-dots:after {
  right: -0.42px;
}
.coupon-detail .detail-head {
  height: 276px;
  padding: 40px;
  background: #55b5ff;
  color: #fff;
  text-align: center;
  border-radius: 12px;
  position: relative;
  z-index: 1;
}
.coupon-detail .detail-head:after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  border-bottom: 2px dashed #fff;
}
.coupon-detail .detail-head .inner {
  height: 200px;
  padding: 20px 0;
  border: 2px solid #fff;
  position: relative;
  display: -webkit-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  flex-direction: column;
  -webkit-flex-direction: column;
  justify-content: center;
}

.coupon-detail .detail-head .inner .childs {
  padding-top: 0.4px;
  display: -webkit-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
}
.coupon-detail .detail-head .inner .child {
  width: 50%;
  -webkit-box-flex: 1;
  -webkit-flex: 1;
  -ms-flex: 1;
  flex: 1;
}
.coupon-detail .detail-head .inner .child:nth-child(1) {
  padding-right: 1.2px;
  text-align: right;
}
.coupon-detail .detail-head .inner .child:nth-child(2) {
  padding-left: 1.2px;
  text-align: left;
}

.coupon-detail .detail-head .title {
  height: 40px;
  position: absolute;
  top: -26px;
  left: 0;
  right: 0;
  text-align: center;
}
.coupon-detail .detail-head .title .text {
  height: 60px;
  line-height: 60px;
  max-width: 80%;
  padding: 0 2px;
  background: #55b5ff;
  font-size: 30px;
  display: inline-block;
  overflow: hidden;
}
.coupon-detail .detail-head .bigtitle {
  height: 72px;
  font-size: 72px;
  line-height: 80px;
}
.coupon-detail .detail-head .subtitle {
  font-size: 30px;
  overflow: hidden;
}
.coupon-detail .detail-head .subtitle .bold {
  font-weight: bold;
}
.coupon-detail .detail-head .threetitle {
  font-size: 20px;
  overflow: hidden;
}
.coupon-detail .detail-head .usetime {
  height: 32px;
  position: absolute;
  bottom: -0.4px;
  left: 0;
  right: 0;
  text-align: center;
}
.coupon-detail .detail-head .usetime .text {
  height: 60px;
  line-height: 60px;
  max-width: 80%;
  padding: 0 2px;
  background: #55b5ff;
  font-size: 30px;
  display: inline-block;
  overflow: hidden;
}
.coupon-detail .detail-body {
  height: auto;
  padding: 0 40px 40px;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 100px;
}
.coupon-detail .detail-body .block {
  height: auto;
  padding-bottom: 30px;
  font-size: 30px;
  position: relative;
}
.coupon-detail .detail-body .block:before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  border-top: 2px dashed #e3e3e3;
}
.coupon-detail .detail-body .block:first-child:before {
  display: none;
}
.coupon-detail .detail-body .block .title {
  padding-top: 40px;
  padding-bottom: 20px;
  color: #999;
}
.coupon-detail .detail-body .block .text {
  color: #1a1a1a;
}
.coupon-detail .detail-body .block .text.dot {
  position: relative;
}
.coupon-detail .detail-body .block .text.dot:before {
  content: "";
  height: 0.22px;
  width: 0.22px;
  background: #55b5ff;
  border-radius: 0.22px;
  position: absolute;
  top: 0.22px;
  left: -20px;
}
/* 详情页其他 色调 */
.coupon-detail.red .detail-head,
.coupon-detail.red .detail-body .block .text.dot:before,
.coupon-detail.red .detail-head .title .text,
.coupon-detail.red .detail-head .usetime .text {
  background: #fd5554;
}
.coupon-detail.pink .detail-head,
.coupon-detail.pink .detail-body .block .text.dot:before,
.coupon-detail.pink .detail-head .title .text,
.coupon-detail.pink .detail-head .usetime .text {
  background: #fd72d4;
}
.coupon-detail.orange .detail-head,
.coupon-detail.orange .detail-body .block .text.dot:before,
.coupon-detail.orange .detail-head .title .text,
.coupon-detail.orange .detail-head .usetime .text {
  background: #ff913f;
}
.coupon-detail.gray .detail-head,
.coupon-detail.gray .detail-body .block .text.dot:before,
.coupon-detail.gray .detail-head .title .text,
.coupon-detail.gray .detail-head .usetime .text {
  background: #b3b3b3;
}
/* 优惠券选中样式 */
.coupon-list.mini .coupon-item.active .coupon-dots:before {
  border: 2px solid #55b5ff;
  left: 5.8px;
}
.coupon-list.mini .coupon-item.active .coupon-dots:after {
  border: 2px solid #55b5ff;
  left: 5.8px;
}
.coupon-list.mini .coupon-item.active .coupon-right {
  border-top: 2px solid #55b5ff;
  border-bottom: 2px solid #55b5ff;
}
.coupon-list.mini .coupon-item.active .coupon-after {
  border-top: 2px solid #55b5ff;
  border-bottom: 2px solid #55b5ff;
  border-right: 2px solid #55b5ff;
}
.coupon-list.mini .coupon-item.red.active .coupon-dots:before {
  border: 2px solid #fd5554;
  left: 5.8px;
}
.coupon-list.mini .coupon-item.red.active .coupon-dots:after {
  border: 2px solid #fd5554;
  left: 5.8px;
}
.coupon-list.mini .coupon-item.red.active .coupon-right {
  border-top: 2px solid #fd5554;
  border-bottom: 2px solid #fd5554;
}
.coupon-list.mini .coupon-item.red.active .coupon-after {
  border-top: 2px solid #fd5554;
  border-bottom: 2px solid #fd5554;
  border-right: 2px solid #fd5554;
}
.coupon-list.mini .coupon-item.pink.active .coupon-dots:before {
  border: 2px solid #fd72d4;
  left: 5.8px;
}
.coupon-list.mini .coupon-item.pink.active .coupon-dots:after {
  border: 2px solid #fd72d4;
  left: 5.8px;
}
.coupon-list.mini .coupon-item.pink.active .coupon-right {
  border-top: 2px solid #fd72d4;
  border-bottom: 2px solid #fd72d4;
}
.coupon-list.mini .coupon-item.pink.active .coupon-after {
  border-top: 2px solid #fd72d4;
  border-bottom: 2px solid #fd72d4;
  border-right: 2px solid #fd72d4;
}
.coupon-list.mini .coupon-item.orange.active .coupon-dots:before {
  border: 2px solid #ff913f;
  left: 5.8px;
}
.coupon-list.mini .coupon-item.orange.active .coupon-dots:after {
  border: 2px solid #ff913f;
  left: 5.8px;
}
.coupon-list.mini .coupon-item.orange.active .coupon-right {
  border-top: 2px solid #ff913f;
  border-bottom: 2px solid #ff913f;
}
.coupon-list.mini .coupon-item.orange.active .coupon-after {
  border-top: 2px solid #ff913f;
  border-bottom: 2px solid #ff913f;
  border-right: 2px solid #ff913f;
}
.coupon-list.mini .coupon-item.gray.active .coupon-dots:before {
  border: 2px solid #b3b3b3;
  left: 5.8px;
}
.coupon-list.mini .coupon-item.gray.active .coupon-dots:after {
  border: 2px solid #b3b3b3;
  left: 5.8px;
}
.coupon-list.mini .coupon-item.gray.active .coupon-right {
  border-top: 2px solid #b3b3b3;
  border-bottom: 2px solid #b3b3b3;
}
.coupon-list.mini .coupon-item.gray.active .coupon-after {
  border-top: 2px solid #b3b3b3;
  border-bottom: 2px solid #b3b3b3;
  border-right: 2px solid #b3b3b3;
}
/* 详情页底部按钮 */
.btn.btn-blue {
  background: #55b5ff;
  border: 0;
}
.btn.btn-red {
  background: #fd5554;
  border: 0;
}
.btn.btn-pink {
  background: #fd72d4;
  border: 0;
}
.btn.btn-orange {
  background: #ff913f;
  border: 0;
}
.btn.btn-gray {
  background: #b3b3b3;
  border: 0;
}
.fui-navbar {
  width: 100%;
  height: 100px;
  background: #fd5554;
  color: #ffffff;
  font-size: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: fixed;
  bottom: 0;
}
.text {
  font-size: 30px;
}
.wanc {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1100;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  // background: rgba(255, 255, 255, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  .wanc-a {
    width: 70%;
    // height: 650px;
    background-color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    .wanc-b {
      width: 90%;
      // height: 220px;
      margin: 40px 0;
      margin-top: 60px;
      font-size: 32px;
      line-height: 1.75;
      display: flex;
      align-items: center;
      flex-direction: column;
    }
    .wanc-c {
      width: 100%;
      height: 80px;
      display: flex;
      align-items: center;
      justify-content: center;
      border-top: 2px solid #eeeeee;
      .wanc-c-a {
        width: 50%;
        height: 80px;
        display: flex;
        align-items: center;
        justify-content: center;
      }
    }
    // .wanc-d{
    //   // width: 100%;

    // }
    .wanc-img {
      width: 400px;
      margin-bottom: 40px;
    }
  }
}
.yvs {
  color: #00b386;
}
</style>
